package PantallasCliente;
import java.awt.Dimension;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class PantallaEsperandoUnirsePartida implements WindowListener{

/************atributos*******************************************/
    private JFrame VentanaEsperando;
/*****************************************************************/

/************métodos**********************************************/
    public PantallaEsperandoUnirsePartida(){
        crearPantalla();
        mostrarPantalla();
    }

    public void crearPantalla(){
        VentanaEsperando = new JFrame("El Juego");
        VentanaEsperando.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        VentanaEsperando.setBounds(100, 100, 200, 300);
        VentanaEsperando.getContentPane().setLayout(null);
        VentanaEsperando.addWindowListener(this);

        JLabel titulo = new JLabel("Espere mientras se une a la partida...");
        titulo.setBounds(15, 10, 100, 20);
        titulo.setPreferredSize(new Dimension(100, 30));
        VentanaEsperando.getContentPane().add(titulo);
    }
    public void mostrarPantalla(){
        VentanaEsperando.setVisible(true);
    }
    public void ocultarPantalla(){
        VentanaEsperando.setVisible(false);
    }

    public void windowOpened(WindowEvent e) { }

    public void windowClosing(WindowEvent e) {
        System.exit(0);
    }

    public void windowClosed(WindowEvent e) {
        System.exit(0);
    }

    public void windowIconified(WindowEvent e) { }
    public void windowDeiconified(WindowEvent e) { }
    public void windowActivated(WindowEvent e) { }
    public void windowDeactivated(WindowEvent e) { }
/*****************************************************************/
}
